package com.hjm.admin.moule.view.activity.impl;

import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;

import com.hjm.admin.moule.R;
import com.hjm.admin.moule.utils.SharedPreUtils;
import com.hjm.admin.moule.view.base.BaseActivity;
import com.hjm.admin.moule.view.base.BaseFragment;

import me.wangyuwei.particleview.ParticleView;

public class SplashActivity extends BaseActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setBinddingView(R.layout.activity_splash, null);
        ParticleView pv = findViewById(R.id.pv_logo);
        pv.setOnParticleAnimListener(() -> {
            String username = SharedPreUtils.getInstance().getString("username", "");
            startActivity(new Intent(SplashActivity.this, MainActivity.class));
//            if (TextUtils.isEmpty(username)) {
//                startActivity(new Intent(SplashActivity.this, LoginActivity.class));
//            } else {
//                startActivity(new Intent(SplashActivity.this, MainActivity.class));
//            }
            finish();
        });
        pv.startAnim();
    }
}
